dropcaps.sty
a style file for dropping caps ()
-10pt3cmsl10In a previous issue of (vol. 1, No. 4, 1992), Peter Flynn dedicates a subsection of Typographer's Inn to the problem of dropped capitals. This is my answer to some of his questions. Basically, I don't start with the capital, but I let the capital's size depend on the chosen design. I wrote a dropped caps macro for use with LATEX, and took these design decisions:
Usage
-10pt3cmsl10My dropcaps.sty is a LATEX style
file, that defines a macro command \bigdrop
that enables you to
drop capitals at the beginning of a paragraph. The layout can be
controlled in various ways, with four parameters (not optional). For
instance, the current paragraph started with
\bigdrop{-10pt}{3}{cmsl10}{M}y ...
The required parameters are:
The messy details
-10pt3cmsl10When the macro \bigdrop
is called
(with four parameters), this is what happens. First, a capital "I" is
typeset in the current text font and put in a box (box1
). The
desired font height (\wantedheight
) is then computed from
(n-1)*\baselineskip+\ht1
, where n is the number of lines
to indent. Then the procedure differs, depending on the choice for DVIPS
or not.
DVIPS users
In this case the text to be capitalized, typeset in the chosen font
(at scale 1000
), is put in a box (box0
), with height
\actualheight
= \ht0
. Now, the scaling factor for this
font can be computed from dividing \wantedheight
by
\actualheight
and multiplying this by 1000
. Because
divisions are integer, the heights are first put in count registers,
and then, to prevent from rounding errors and overflow,
\wantedheight*10
is divided by \actualheight/100
. The
outcome of this is the scale at which the chosen font is typeset.
non-DVIPS users
Without DVIPS things are less elegant, for only the standard magsteps
are available for scaling fonts. The text
to be capitalized in the chosen font, is first typeset at
\magstep 0
and put in a box (box0
), with height \ht0
.
If \wantedheight
is bigger then \ht0
, the text is typeset
at \magstephalf
, and put in box0
again. If
\wantedheight
is still bigger then \ht0
, again the
\magstep
is increased one step, et cetera. This process is
repeated until \wantedheight
is smaller then \ht0
.
both
The result of the computation can be observed on the screen and in the
.log file. Each time a capital is dropped, two lines like
*** Needed height: 30.83331pt, Unscaled height: 6.83331pt
*** cmsl10 scaled 4512 ==> height: 30.83195pt (error: 0.00136pt).
appear. This example is from processing this document with n = 3
and font cmsl10.
At the end of the computation box0 contains the text, typeset in
the desired font and scaled such that \ht0
equals the height of
the indenting lines. Then, \hangindent
and \hangafter
are
set according to box0 and the parameter values:
\hangindent:=\wd0+#1
, and \hangafter:=-#2
.
Precautions are taken for the case that \dp0
is not equal to
zero. Finally, in a LATEX
picture environment, the text is placed where we want it.
Requirements
-10pt3cmsl10In order to use this style file, a big version of LATEX is needed, because almost always fonts have to be generated, and already from 4 indenting lines, they tend to become very large. I tested this with emTEX's TEX386 (with emx) on a 486DX33 PC, and with emTEX's bTEX186 on a AT286 PC.
Also needed is a version of DVIPS by Tomas Rokicki with MakeTeXPK running, so the generation of fonts will be done automatically. For me the recently uploaded DVIPS 5.518 works great on both machines.
All this is necessary because the implemented procedure in this macro automatically leads to non-standard fonts. So, for optimal pleasure, use a big TEX and Rokicki's DVIPS.
Alternatives
-10pt3cmsl10Only one style file that does something similar is listed in TEX–index v1.06 by David M. Jones, namely drop.sty by David G. Cantor. The latest version is dated 17–02–1988. This style file also defines a macro to drop capitals, but has no possibilities to accept controlling parameters, except for the choice of font. You are not able to choose the desired height by supplying the number of lines to be indented.
The dropped capital has a fixed size, namely \magstep5
, and
always two lines are indented. This font height is somewhat smaller
than the height of two indenting lines, so the vertical placement of
the dropped capital's baseline lies not at the same height as the
vertical placement of the baseline of the second indenting line (next
to it). The advantage of this is that everyone has this font.